package com.riversoft.weixin.app.wxacode;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.riversoft.weixin.common.util.JsonMapper;

import java.io.Serializable;

public class WxMaWxcode implements Serializable {
    private static final long serialVersionUID = 1287399621649210322L;

    private String path;
    private int width = 430;

    @JsonProperty("auto_color")
    private boolean autoColor = true;

    @JsonProperty("is_hyaline")
    private boolean isHyaline = false;

    @JsonProperty("line_color")
    private WxMaCodeLineColor lineColor = new WxMaCodeLineColor("0", "0", "0");

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public boolean isAutoColor() {
        return autoColor;
    }

    public void setAutoColor(boolean autoColor) {
        this.autoColor = autoColor;
    }

    public boolean isHyaline() {
        return isHyaline;
    }

    public void setHyaline(boolean hyaline) {
        isHyaline = hyaline;
    }

    public WxMaCodeLineColor getLineColor() {
        return lineColor;
    }

    public void setLineColor(WxMaCodeLineColor lineColor) {
        this.lineColor = lineColor;
    }

    public static WxMaWxcode fromJson(String json) {
        return JsonMapper.defaultMapper().fromJson(json, WxMaWxcode.class);
    }
}